/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.brainy.perseu.generic.interfaces;

import br.com.brainy.perseu.generic.exeptions.BankException;
import java.io.Serializable;
import java.util.List;

/**
 * This interface is responsable to all on the crud
 * 
 * 
 * @author Luiz Segundo
 */
 public interface IGenericDAO<T extends Serializable> {
       
        
        /**
         * 
         * This method, when implemented, is reponsable to add all the objects
         * on BD
         * 
         * @param t
         * @return true if it's correct
         */
        boolean addObject(T t) throws BankException;
        
        /**
         * 
         * This method, when implemented, is reponsable to remove all the objects
         * on BD
         * 
         * @param t
         * @return true if ti's coorect
         */
        boolean removeObject(T t) throws BankException;
        
        /**
         * 
         * This method, when implemented, is reponsable to update all the objects
         * on BD
         * 
         * @param t
         * @return true if ti's coorect
         */
        boolean updateObject(T t) throws BankException;    
        
        List<T> searchForAttributeString(String attribute, String search) throws BankException;
        T searchObjectForNameLastName(String name, String lastName) throws BankException;
        List<T> searchObjectForName(String name) throws BankException;
        T searchObjectForID(Long id) throws BankException;
        List<T> listAll();
        
}
